﻿@model workflowMVC.Models.CreatePostModel

@{
    ViewBag.Title = "Post";
}

<h2 style="text-align:center">Tạo bài dự thi </h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <div id="upload-dialog" title="Upload Ảnh">
        <iframe src = "@Url.Action("UploadImgBox","Util")" height="200px" width = "420px">
        <p>Your browser does not support iframes.</p>
        </iframe>
    </div>
    <table class="ui-widget-content ui-corner-all" style="margin:auto;padding:5px">  
        <tr>
            <td>
                @Html.LabelFor(model => model.Tittle)
            </td>
            <td>
                @Html.TextBoxFor(model => model.Tittle)
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                @Html.ValidationMessageFor(model => model.Tittle)
            </td>
        </tr>
        <tr>
            <td>
                Công cụ
            </td>
            <td>
                <button class="uploadImg">Upload ảnh</button>
            </td>
        </tr>
      
        <tr>
            <td>
                @Html.LabelFor(model => model.TestContent)
            </td>
            <td>
                @Html.TextAreaFor(model => model.TestContent, new { @class = "mceEditor" })
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                @Html.ValidationMessageFor(model => model.TestContent)
            </td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="Gửi" /></td>
        </tr>
        
    </table>
}
    <script type="text/javascript">
        $(".uploadImg").live("click", function () {
            $("#upload-dialog").dialog({
                autoOpen: true,
                width: 450,
                modal: true,
                buttons: {
                    "Đóng Lại": function () {
                        $(this).dialog("close");

                    }
                }
            });

            return false;

        });
        $(function () {
            $("#upload-dialog").dialog({ autoOpen: false });
        });
	</script>

    <script type="text/javascript" src="../../Scripts/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
        tinyMCE.init({
            mode: "textareas",
            editor_selector: "mceEditor",
            theme: "advanced",
            height: "500px",
            plugins: "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
            theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
            theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
            theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
            theme_advanced_toolbar_location: "top",
            theme_advanced_toolbar_align: "left",
            theme_advanced_statusbar_location: "bottom",
            theme_advanced_resizing: false,
            template_external_list_url: "js/template_list.js",
            external_link_list_url: "js/link_list.js",
            external_image_list_url: "js/image_list.js",
            media_external_list_url: "js/media_list.js"
        });
    </script>